
function StopServices
{
    $servicesArray = 
		"AlarmServiceHost",
		"CoreServicesHost",
		"CoreServicesHostx64",
		"DataServicesHost",
		"DataServicesHostx64",
		"ProviderEngineHost",
		"ProviderEngineHostx64",
		"PowerCloudAgentService",
		"PMLMK",
		"IONComtradeProcessor",
		"PMLCM",
		"DeviceReplacement",
		"IONDiagnosticsAndUsage",
		"IONEW",
		"PMLLogServer",
		"PMLOGROUTER",
		"ManagedCircuitService",
		"PMLNetman",
		"PMLOPC",
		"IONOPCUAServer",
		"PQDIFExporter",
		"PMLQueryServer",
		"PMLION",
		"IONRS",
		"PMLSS",
		"SWABUS",
		"PMALARM",
		"SWMDBUS",
		"IONSL",
		"PMLVIP_VIP.DDD",
		"PMLVIP_VIP.DEFAULT",
		"PMLVIP_VIP.PQADVISOR",
		"PMLXMLSubscriptions",
		"PMLXMLSubscriptionStore"


    foreach($service in $servicesArray)
    {
        if (Get-Service $service -ErrorAction SilentlyContinue)
        {
            Write-Host "Stopping service: $service" -ForegroundColor White
            Stop-Service $service -Force
        }
    }
}

Write-Host "*** Stopping services ***" -ForegroundColor DarkCyan
StopServices
Write-Host "*** Completed stopping services ***" -ForegroundColor DarkCyan
